/* PGM 平台自定义样式 */

/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: bold;
}

.navbar-brand i {
    margin-right: 8px;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
}

/* 表格样式 */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* 按钮样式 */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn i {
    margin-right: 4px;
}

.btn-group-sm .btn i {
    margin-right: 2px;
}

/* 徽章样式 */
.badge {
    font-size: 0.75em;
    margin-left: 4px;
}

/* 分页样式 */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: #495057;
    border-color: #dee2e6;
}

.page-link:hover {
    color: #0056b3;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

/* 表单样式 */
.form-label {
    font-weight: 500;
    color: #495057;
}

.form-control:focus,
.form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 加载状态 */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 响应式表格 */
.table-responsive {
    border-radius: 0.375rem;
}

/* 工具提示样式 */
.tooltip-inner {
    max-width: 300px;
    text-align: left;
}

/* 首页卡片特殊样式 */
.card.h-100 {
    transition: transform 0.2s ease-in-out;
}

.card.h-100:hover {
    transform: translateY(-2px);
}

/* 搜索栏样式 */
.search-container {
    position: relative;
}

.search-container .form-control {
    padding-right: 2.5rem;
}

.search-container .search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* 状态指示器 */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-indicator.success {
    background-color: #28a745;
}

.status-indicator.error {
    background-color: #dc3545;
}

.status-indicator.warning {
    background-color: #ffc107;
}

/* 数据类型标签 */
.data-type-badge {
    font-size: 0.7em;
    padding: 0.2em 0.4em;
    border-radius: 0.2rem;
    background-color: #e9ecef;
    color: #495057;
}

/* 主键字段特殊样式 */
.primary-key-field {
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.primary-key-field:focus {
    border-color: #ffd32a;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

/* 必填字段标识 */
.required-field::after {
    content: " *";
    color: #dc3545;
}

/* 空值显示 */
.null-value {
    font-style: italic;
    color: #6c757d;
    opacity: 0.7;
}

/* 长文本截断 */
.text-truncate-long {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.text-truncate-long:hover {
    color: #007bff;
}

/* 操作按钮组 */
.action-buttons {
    white-space: nowrap;
}

.action-buttons .btn {
    margin-right: 0.25rem;
}

.action-buttons .btn:last-child {
    margin-right: 0;
}

/* 统计信息样式 */
.stats-card {
    border-left: 4px solid #007bff;
}

.stats-number {
    font-size: 2rem;
    font-weight: bold;
    color: #007bff;
}

/* 错误页面样式 */
.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e9ecef;
    }
    
    .card {
        background-color: #2d3748;
        border-color: #4a5568;
    }
    
    .table th {
        background-color: #2d3748;
        color: #e9ecef;
    }
    
    .table-hover tbody tr:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-bottom: 0.25rem;
        border-radius: 0.375rem !important;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .pagination {
        font-size: 0.875rem;
    }
}

/* 打印样式 */
@media print {
    .navbar,
    .btn,
    .pagination,
    .action-buttons {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .table {
        border-collapse: collapse;
    }
    
    .table th,
    .table td {
        border: 1px solid #000 !important;
    }
}